yii2-floor12-files-block.js ➔ filesDownloadAll   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 2
1
function filesDownloadAll(title, event, yiiDownloadAllLink) {
2
    obj = $(event.target).parents('div.files-block');
0 ignored issues
show
Bug introduced by
The variable obj seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.obj.
Loading history...
3
    hashes = "";
0 ignored issues
show
Bug introduced by
The variable hashes seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.hashes.
Loading history...
4
    $.each(obj.find('.f12-file-object'), function (key, val) {
5
        hashes += "&hash[]=" + $(val).data('hash');
0 ignored issues
show
Bug introduced by
The variable hashes seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.hashes.
Loading history...
6
    });
7
    console.log(hashes);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
8
9
    window.open(yiiDownloadAllLink + "?title=" + title + hashes);
10
11
}